package com.vrv.app;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;

/**
 * @Description 登录
 *
 * @author 曹保利
 * @date
 */
@SuppressWarnings("unused")
public class LoginActivity extends Activity {

    /** 账号 */

    private EditText accountExt;
    /** 密码 */
    private EditText passwdExt;
    /** 记住密码 */
    private CheckBox rememberPwdChk;
    /** 登录 */
    private Button loginBtn;
    /** 判断是否自动登录 */
    private CheckBox autoLogin;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_login);
        initView();
    }

    private void initView() {
        accountExt = (EditText) findViewById(R.id.accountExt);
        passwdExt = (EditText) findViewById(R.id.passwdExt);
        rememberPwdChk = (CheckBox) findViewById(R.id.rememberPasswdChk);
        autoLogin = (CheckBox) findViewById(R.id.autoLogin);
        loginBtn = (Button) findViewById(R.id.loginBtn);
        loginBtn.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                forward();
            }
        });
    }

    /**
     * 进入主界面
     */
    private void forward() {
        Intent intent = new Intent();
        intent.setClass(LoginActivity.this, MainTableActivity.class);
        LoginActivity.this.startActivity(intent);
        finish();
    }
}
